package com.igeek.rowmapper;

import com.igeek.entity.Department;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DepMapper implements RowMapper<Department> {

    @Override
    public Department mapRow(ResultSet resultSet, int i) throws SQLException {
        Department dep = new Department();
        dep.setDepId(resultSet.getInt(1));
        dep.setDepName(resultSet.getString(2));
        dep.setManagerId(resultSet.getInt(3));
        return dep;
    }
}
